package com.crl.map.utils.astar
{
	public class XYSet
	{
		private var w:int;
		private var h:int;
		private var list:Array;
		public function XYSet(w:int,h:int)
		{
			this.w=w;
			this.h=h;
			list=new Array(w*h);
		}
		
		public function add(x:int,y:int):void{
			list[x*w+y]=1;
		}
		public function remove(x:int,y:int):void{
			list[x*w+y]=0;
		}
		
		public function contains(x:int,y:int):Boolean{
			return list[x*w+y]==1;
		}
		
		public function clear():void{
			list=new Array(w*h);
		}
	}
}